home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 2.6 KB | 56 lines | [TEXT/GEOL] |
- Apple II
- Technical Notes
- _____________________________________________________________________________
- Developer Technical Support
- GS/OS
- #10: How Applications Find Their Files
-
- Revised by: Matt Deatherage May 1992
- Written by: Dave Lyons January 1990
-
- This Technical Note explains how applications should find configuration and
- other application-related files.
-
- CHANGES SINCE SEPTEMBER 1990: Lists new ways to access the @ prefix under
- System Software 6.0 and later.
- _____________________________________________________________________________
-
-
- When an application is launched, GS/OS sets prefix 9 to the application's
- parent directory. It also sets prefix 1 to the same directory if the length
- of the pathname is within a 64-character limit. It does not set prefix 0 to
- any special value.
-
- If your application uses a partial pathname and depends upon prefix 0 to find
- files at the same directory level, it may be working by accident (prefix 0 is
- accidently set to the right directory), and sooner or later it won't work.
-
- If your application needs to load a file named TitleScreen, the best way is to
- use the pathname 9:TitleScreen. If you just use TitleScreen, you are using
- prefix 0, and you may or may not be looking in the right directory.
-
- Files storing user-specific data should be stored in the at sign (@)
- prefix--this is just like prefix 9, except that it is set to the user's user
- folder on an AppleShare server if the application was launched from a server.
- Use @:MySettings rather than 9:MySettings or MySettings. (If you want to
- retrieve the value of the @ prefix, you can call ExpandPath on the pathname
- "@:".) Note that the @ prefix was introduced in System Software 5.0.
-
- The @ prefix is useful only for applications, not for Desk Accessories, CDevs,
- initialization files, or anything else; this type of code can get the path of
- the user's folder by using the AppleShare FST's FST-Specific call GetUserPath.
-
- Starting with System Software 6.0, you can also retrieve the value of the @
- prefix by passing $FFFF (-1) to GetPrefix. You may also set the value of the
- @ prefix by passing $FFFF to SetPrefix, but only applications or system-wide
- utilities should ever change the @ prefix. Specifically, any DAs, CDevs,
- initialization files or others should not mess with the @ prefix to make their
- own file handling simpler.
-
-
- Further Reference
- _____________________________________________________________________________
-
- o GS/OS Reference
- o AppleTalk Technical Note #8, Using the @ Prefix
-